package com.example.study.plus.mybatis_plus.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * <p>
 * 好友关联表
 * </p>
 *
 * @author 路飞4
 * @since 2023-08-18
 */
@Getter
@Setter
@TableName("friend")
@ApiModel(value = "Friend对象", description = "好友关联表")
@ToString
public class Friend implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("来源用户ID")
    @TableField("fromId")
    private Long fromId;

    @ApiModelProperty("接受用户ID")
    @TableField("acceptId")
    private Long acceptId;

    @ApiModelProperty("好友申请的状态 100:申请中,200:已同意")
    @TableField("status")
    private Integer status;

    @ApiModelProperty("逻辑删除")
    @TableField("deleted")
    @TableLogic
    private Integer deleted;

    @ApiModelProperty("创建时间")
    @TableField(value = "createTime", fill = FieldFill.INSERT)
    private String createTime;

    @ApiModelProperty("更新时间")
    @TableField(value = "updateTime", fill = FieldFill.INSERT_UPDATE)
    private String updateTime;

    @ApiModelProperty("乐观锁，使用时每次修改数据+1")
    @TableField("version")
    @Version
    private Integer version;
}
